package com.silence.gankio.mvp.presenter

import com.silence.gankio.mvp.control.HttpControl
import com.silence.gankio.mvp.control.IControl
import java.lang.ref.WeakReference

open class BasePresenter<V : IControl.IView>(view: V) : HttpControl.IHttpPresenter {

    private val mWeakReference: WeakReference<V> = WeakReference(view)


    override fun getView(): V? {
        val v = mWeakReference.get()
        if (v != null) {
            return v
        }
        return null
    }

    override fun unAttch() {
        mWeakReference.clear()
    }


}